package net.danielthompson.danray.cameras;

import net.danielthompson.danray.structures.Point;
import net.danielthompson.danray.structures.Vector;

/**
 * Created by daniel on 1/18/14.
 */
public class SimpleStochasticCamera implements Camera {

   private Point _rearFocalPoint;

   public SimpleStochasticCamera(Point rearFocalPoint) {
      _rearFocalPoint = rearFocalPoint;
   }

   @Override
   public Point GetWorldPointForPixel(int x, int y) {
      return null;
   }

   @Override
   public Point GetWorldPointForPixel(double x, double y) {
      return null;
   }

   @Override
   public Vector[] GetInitialStochasticRaysForPixel(double x, double y, int SamplesPerPixel) {
      return new Vector[0];
   }

   @Override
   public Vector[] GetInitialStochasticRaysForPixel(int x, int y, int SamplesPerPixel) {
      Vector[] vectors = new Vector[SamplesPerPixel * SamplesPerPixel];
      int vectorPointer = 0;

      for (int i = 0; i < SamplesPerPixel * SamplesPerPixel; i++) {
         double newX = x + Math.random();
         double newY = y + Math.random();
         vectors[vectorPointer++] = new Vector(_rearFocalPoint, Point.Minus(new Point(newX, newY, 0), _rearFocalPoint));
      }

      return vectors;
   }

   @Override
   public Vector GetStochasticRayForPixel(double x, double y) {
      return null;
   }
}
